<!-- components/SubMenu.vue -->
<template>
  <ul v-if="subMenuItems">
    <li v-for="item in subMenuItems" :key="item.name">
      <a @click="navigateTo(item)">{{ item.text }}</a>
    </li>
  </ul>
</template>

<script>
export default {
  computed: {
    subMenuItems() {
      return this.$store.getters.currentSubMenu;
    }
  },
  methods: {
    navigateTo(item) {
      // 更新视图逻辑
      this.$store.commit('UPDATE_VIEW', item.name);
    }
  }
};
</script>